<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Set处理网站关键词</title>
    <style>
        *{
            padding: 0;
            margin: 0;
        }

        body{
            width: 100vw;
            height: 100vh;
            padding: 150px;
        }

        ul{
            list-style: none;
            width: 200px;
        }

        li:nth-of-type(odd){
            background:yellowgreen;
        }
    </style>
</head>
<body>
    <input type="text" name="hd">
    <ul></ul>
    <script>
        let obj = {
            data : new Set(),
            set keyword(word){
                this.data.add(word);
            },
            show(){
                let ul = document.querySelector('ul');
                ul.innerHTML = "";
                this.data.forEach(function (value) {
                    ul.innerHTML += `<li>${value}</li>`;
                });
            }
        };
        document.querySelector('[name="hd"]').addEventListener('blur',function () {
            obj.keyword = this.value;
            obj.show();
        })

    </script>
</body>
</html>